package aaa.mistake.controller;

import aaa.common.core.controller.BaseController;
import aaa.mistake.domain.MistakeDTO;
import aaa.mistake.service.IMistakeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/mistake")
public class MistakeController extends BaseController{

    @Autowired
    private IMistakeService mistakeService;
    @PreAuthorize("@ss.hasPermi('center:mistake:list')")
    @GetMapping("/getMistakes")
    public List<MistakeDTO> getMistakes(@RequestParam int userId) {
        return mistakeService.getMistakesByUserId(userId);
    }
}